// pages/rentlorder/renord.js
const request = require('../../utils/request.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    bx:[
      {id:1,name:'咖啡机咖啡机1',jia:'200',ya:"200",bian:"22",zt:"1",ztt:"待付款",img:'/static/img/sp.png',url:'/pages/orderdetails/order'},
      {id:2,name:'咖啡机咖啡机1',jia:'200',ya:"200",bian:"22",zt:"1",ztt:"待收货",img:'/static/img/sp2.png',url:'/pages/pendingdelivery/pendin'},
      {id:3,name:'咖啡机咖啡机1',jia:'200',ya:"200",bian:"22",zt:"1",ztt:"租赁中",img:'/static/img/sp3.png',url:'/pages/duringlease/during'},
      {id:4,name:'咖啡机咖啡机1',jia:'200',ya:"200",bian:"22",zt:"1",ztt:"已到期",img:'/static/img/sp4.png',url:'/pages/expired/expired'},
      {id:5,name:'咖啡机咖啡机1',jia:'200',ya:"200",bian:"22",zt:"1",ztt:"已归还",img:'/static/img/sp5.png',url:'/pages/returned/return'},
    ],
    zd:'',
  },
  onTabsChange(event) {
    console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
  },

  onTabsClick(event) {
    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
  },
  zldd(){
    const that = this
    request.wxRequest(
      "order/list",
      function (err, data) {
        console.log(data)
        if (err) {
          // 失败；
        } else {
          that.setData({
           zd: data.data.list
          });
        }
      },
      "GET",
    )
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.zldd()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})